#pragma once
#include <iostream>
#include <vector>
#include <list>

namespace std
{
    std::vector<std::string> split(std::string str, std::string pattern);
    std::string &replaceAWithX(std::string &str, std::string spl, std::string dest);
    std::string &trim(std::string &s, std::string split = " ");
    template <typename... Args>
    std::string format(const string &format, Args... args)
    {
        size_t size = 1 + snprintf(nullptr, 0, format.c_str(), args...);
        //std::unique_ptr<char[]> bytes(new char[size]);
        char bytes[1024];
        snprintf(bytes, size, format.c_str(), args...);
        return string(bytes);
    }
} // namespace gconvert